Skip to content

Conversation

ccloes-intuit
Copy link
Contributor

@Suryanarayanan Please review for fix on RHEL 7

@surybala
Copy link
Contributor

I don't think this solves the underlying issue. The 'functions' file also exists in RHEL7 so this change doesn't fix the problem. I think I figured out what is the problem here. The custom commands 'start-no-update' and 'start-with-update' don't seem to work well with systemctl. The rpm installation uses 'start-no-update' command. This doesn't activate the agent's service unit in systemctl.

$systemctl list-units --type service --all | grep codedeploy
codedeploy-agent.service loaded inactive dead LSB: AWS CodeDeploy Host Agent

I can fix the rpm to call 'start' instead of 'start-no-update'. The bigger issue here is whether to have a feature that is supported only on a subset of officially supported OSes. This makes it harder to maintain the code. We would ideally want to support running the agent as a different user in all of the supported linux OSes. This means we might have to use a different way to run as arbitrary user in Ubuntu systems say something like 'start-stop-daemon'. It would be great if you could make this change generic and would work on all supported OSes. I'll also bring this to team's attention and see what they think.

Thanks,
Surya.

@ccloes-intuit
Copy link
Contributor Author

@Suryanarayanan my apologies, you are correct. I quickly threw this together using docker and didn't see /etc/init.d/functions in my docker image and made an incorrect assumption.

We are using RHEL 6 which is why I focused there. I will look into why this is not starting properly on RHEL 7 based on the information you have provided and try and devise a solution which includes Ubuntu as well. Are there other OS's which need to be supported?

It would be helpful to see your build scripts which produce your RPMs. It would assist in trying to come up with a solutions which are not OS specific.

@surybala
Copy link
Contributor

@ccloes-intuit currently we support AmazonLinux, RHEL and Ubuntu on the linux side of things.

We need to fix two things here:

  1. The 'start-no-update' and 'start-with-update' are the two custom commands in init script that are broken if used with systemctl. If we can fix this then the rpm shouldn't have any stop issue.
    Like I mentioned earlier systemctl activates the codedeploy-agent unit properly only if 'start' command is used but not 'start-no-update' or 'start-with-update'.
  2. The daemon utils might not work on Ubuntu. We need to have an alternate path in the init script for Ubuntu instances to do the right thing when run as an arbitrary user.

Thanks again for your effort and contribution,
Surya.

@ccloes-intuit
Copy link
Contributor Author

@Suryanarayanan ... closing this PR to open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants